package com.tsn.config;

/**
 * <p>
 *
 * </p>
 *
 * @author tsn
 * @since 2021/8/18
 */
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 主要是静态文件的路径映射配置
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // tomcat映射
        registry.addResourceHandler("/upload/**")
                .addResourceLocations("file:/zjcentury/");
//                .addResourceLocations("file:D:/myFile/zjcentury/");
    }
}
